import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  build: {
	  outDir: 'htao-richtext',
	  lib: {
		  entry: path.resolve(__dirname, 'src/components/htao-richtext/index.js'),
		  name: 'htao-richtext',
		  fileName: 'htao-richtext'
	  },
	  rollupOptions: {
		  external: ['vue'],
		  output: {
			  globals: {
				  vue: 'Vue'
			  }
		  }
	  },
	  terserOptions: {
		  compress: {
			  drop_console: true,
			  drop_debugger: true
		  },
		  format: {
			  comments: false
		  }
	  }
  }
})
